widget: Don't check for natives
authorBenjamin Otte <otte@redhat.com>
Sat, 22 Feb 2020 01:47:41 +0000 (02:47 +0100)
committerBenjamin Otte <otte@redhat.com>
Sat, 22 Feb 2020 04:50:07 +0000 (05:50 +0100)
It's the native's job to request a 1px x 1px size, not the job of
gtk_widget_size_allocate()

Also saves 10% of size_allocate() time because checking for an interface
is really expensive.

gtk/gtkwidget.c

index 40663ddb45f8ef65c66afe4d3b00873d56ea1a00..f41b54b3908e5b78c2a6189f2014415d73e52c43 100644 (file)
@@ -4046,12 +4046,6 @@ gtk_widget_allocate (GtkWidget    *widget,
       adjusted.height = 0;
     }
 
-  if (G_UNLIKELY (GTK_IS_NATIVE (widget)))
-    {
-      adjusted.width = MAX (1, adjusted.width);
-      adjusted.height = MAX (1, adjusted.height);
-    }
-
   style = gtk_css_node_get_style (priv->cssnode);
   get_box_margin (style, &margin);
   get_box_border (style, &border);